package com.example.webdatabinder.config;

import org.springframework.format.Formatter;

import java.text.ParseException;
import java.util.Locale;

public class StringFormatter implements Formatter<String> {
    private static final String PREFIX = "convertString == ";

    @Override
    public String parse(String text, Locale locale) throws ParseException {
        //所以String类型参数都加上一个前缀。
        String result = PREFIX + text;
        return result;
    }

    @Override
    public String print(String object, Locale locale) {
        return object;
    }
}


